// 订单信息页
import request from '@/utils/http/http'

// 发送请求获取交易信息的数据
export const reqGetTradeInfo = () => {
  return request.get('/order/auth/trade')
}

// 发送请求去支付订单
export const reqPayOrder = ({ tradeNo, ...data }) => {
  return request.post(`/order/auth/submitOrder?tradeNo=${tradeNo}`, data)
}

// 发送请求获取二维码(获取订单支付信息)
export const reqPayInfo = (orderId) => {
  return request.get(`/payment/weixin/createNative/${orderId}`)
}

// 获取订单支付状态
export const reqGetPayStatus = (orderId) => {
  return request.get(`/payment/weixin/queryPayStatus/${orderId}`)
}

// 获取我的订单列表
export const reqMyPayedList = (page, limit) => {
  return request.get(`/order/auth/${page}/${limit}`)
}
